<?php
namespace app\home\controller;

use dingtalk\util\crypto\Prpcrypt;
use think\Request;
use dingtalk\util\crypto;
use dingtalk\CallBack;
use dingtalk\User;

class IndexController extends BaseController
{
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
    }

    /**
     * 前端模板解析
     * @param Request $request
     * @return mixed
     */
    public function index()
    {
        $arr=['index/index']; //需要直接渲染输出的页面
        $folder = $this->request->param('folder','');
        $file = $this->request->param('file','index');
        if (empty($folder)){
            return $this->fetch();
        }
        $tpl = APP_PATH.'home'.DS.'view'.DS.$folder.DS.$file.'.html';
        if(in_array($folder.'/'.$file,$arr)){
            return $this->fetch($tpl);
        }else{
            echo $this->fetch($tpl);
        }
    }
}
